<?php
namespace org\kahikai\domain;

/**
 * 
 * @author ch4mp
 *
 */
class User {
	var $id;
	var $lastName;
	var $firstName;
	var $email;
	var $profile;
	var $password;
	var $confirmationNumber;
	
	public function __construct(
			$anId,
			$aLastName,
			$aFirstName,
			$anEmail,
			$aProfile,
			$aPassword,
			$aConfirmationNumber) {
		$this->id = $anId;
		$this->lastName = $aLastName;
		$this->firstName = $aFirstName;
		$this->email = $anEmail;
		$this->profile = $aProfile;
		$this->password = $aPassword;
		$this->confirmationNumber = $aConfirmationNumber;
	}
	
	public static function allowedProfiles() {
		return array('admin', 'contributor', 'user');
	}
	
	public function isGrantedFor($requestedProfile) {
		if($this->profile == 'admin') {
			return true;
		} else if($requestedProfile == 'admin') {
			return false;
		} else if($this->profile == 'contributor') {
			return true;
		} else if($requestedProfile == 'contributor') {
			return false;
		} else if($this->profile == 'user') {
			return true;
		}
		return false;
	}
}
?>